<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

$open = fopen("template.htm","r"); //打开模板文件
$content = fread($open,filesize("template.htm")); //读取模板文件内容
//print_r($content);
$content = str_replace("{me:title}","测试标题",$content);//替换
$content = str_replace("{me:contents}","测试内容",$content);

$newtemp = fopen("1.htm","w");//生成,用写入方式打开一个不存在（新）的页面
fwrite($newtemp,$content);//将刚刚替换的内容写入新文件中
fclose($newtemp);
echo "生成";